window.onload=function (){
    findOrder(1);
}

function findOrder(pageNO){
    axios.get("/customer/order/findAll",{
        params:{
            pageNO
        }
    }).then(e => {
        var info = e.data;
        var str = "";
        for (var i=0;i<info.records.length;i++){
            var obj = info.records[i];
            str += `<tr><td>${obj.id}</td><td>${obj.sumPrice}</td><td>${obj.status}</td><td>${obj.orderTime}</td>
                    <td><a href="/customer/orderDatail.html?orderId=${obj.id}">订单详情</a></td></tr>`
        }
        $('orderData').innerHTML = str;
        var pageStr = "";
        for (var i=1;i<=info.pages;i++){
            pageStr += `<a href="javascript:findOrder(${i})">${i}</a>`
        }
        $('cutDiv').innerHTML = pageStr;
    })
}
